<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  <head>
    <title>Flirt - a Flash&#153; Runtime</title>
    <link rel="stylesheet" href="style.css" type="text/css" media="screen" />
    <meta name="description" content="Flirt is an open source, extensible Flash&#153; runtime" />
    <meta name="keywords" CONTENT="Flirt, Flash, runtime, player, open source, GPL">
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  </head>

<body>

<div class="title">
Flirt
</div>

<div class="subtitle">
an open source extensible Flash&#153; runtime
</div>

<div class="hr"></div>

<div class="sidebar">

	<div class="sidebarbox">
	<a class="sidebarlink" href="index.html">About</a><br>
	Rendering<br>
	<a class="sidebarlink" href="script.html">Actionscript</a><br>
	<a class="sidebarlink" href="example.html">Example</a><br>
	<a class="sidebarlink" href="extensions.html">Extension API</a><br>
	<a class="sidebarlink" href="osx.html">OS X</a><br>
	<a class="sidebarlink" href="bugs.html">Bugs</a><br>
	<a class="sidebarlink" href="future.html">Future Directions</a><br>
	</div>

<br>

	<div class="sidebarbox">
	<a class="sidebarlink" href="http://prdownloads.sourceforge.net/flirt/flirt-20040823.tgz?download">Download source</a><br>
	</div>

<br>

	<div class="sidebarbox">
	<a class="sidebarlink" href="mailto:dave@opaque.net?Subject=Flirt">Contact</a><br>
	<br>
	<a class="sidebarlink" href="http://lists.sourceforge.net/lists/listinfo/flirt-devel">Mailing list</a><br>
	<br>
	<a class="sidebarlink" href="http://sourceforge.net/projects/flirt">SourceForge project page</a><br>
	<br>
	<A href="http://sourceforge.net">
	<IMG src="http://sourceforge.net/sflogo.php?group_id=18365&amp;type=1" width="88" height="31" border="0" alt="SourceForge Logo">
	</A>
	</div>

</div>

<div class="content">

<h3>Rendering</h3>

<p>Here's how Flirt renders the classic Postscript tiger (converted to SWF):</p>

<center><img src="tiger.png" width=400 height=300></center>

<p>You'll probably notice the bugs first:</p>

<p><b>Some fills are leaking, some fills are inverted (empty on the inside, jaggy on the out)</b> - This is the biggest headache I've got with Flirt right now. The edges aren't staying in the right left-to-right order, and I can't figure out a good way to make sure they do. The files themselves shouldn't ever give a shape with overlapping edges, but when curves are approximated with a bunch of line segments, things can get a little sloppy.</p>

<p><b>The whiskers should be outlined</b> - Flirt doesn't yet draw lines with greater than pixel-size width. Pixel-width lines are drawn with Wu-antialiasing&mdash;you can see a bunch of pixel gaps in the black outline; that's where Flirt doesn't know to connect two line segments. Thicker lines should be turned into shapes and fed into the shape rasterizer, but I've been putting off doing the math.</p>

<p><b>Flirt can't figure sub-pixel coverage</b> - You can't see it here, but another rendering bug I haven't thought of a good solution for is shapes bleeding out from underneath other shapes. This is, I understand, a pretty common rendering problem, but I haven't done the research to learn how it's fixed. Yeah, yeah, I know: subsampling. See below.</p>

<br>
<p>But if you're generous, you'll note the positives:</p>

<p><b>Antialiasing</b> - I've never liked subsampling for antialiasing; near-horizontal and near-vertical lines look really bad, and text can be ugly as well. Flirt uses simple geometry to compute coverage values. I know there's probably a fancy, professional term for this, but I'm not in the biz.</p>

<p><b>Gradients</b> - Sure, it took less than an hour to implement because Flash gradients are really simple, but they do look nice. Could be a lot faster, though.</p>

<br>
<p>Here's some more rendering bugs:</p>

<ul>
<li>Support for masks isn't great. I think we can do shape-on-shape masks, but not clip-on-shape. Maybe shape-on-clip, I can't remember.
<br><br>
<li>System fonts like _sans aren't supported. I sure don't look forward to figuring out how to get glyphs on every platform out there.
<br><br>
<li>...
</ul>

<div class="hr"></div>

    <div class="footnote">
    <b>All content copyright (C) 2004 Dave Hayden except where noted otherwise.</b>
    <br>
    <b>Macromedia and Flash are registered trademarks of Macromedia, Inc. in the United States and/or other countries.</b>
    </div>

<br>

</div>

</body>
</html>
